#include <iostream>
typedef long long ll;
using namespace std;
int main(){
    int n,m,temp;
    while (cin>>n){
        while(n--) {
            cin>>m;
            ll sum = 0;
            for (int i = 0; i < m; ++i) {
                cin>>temp;
                sum+=temp;
            }
            cout<<sum<<endl;
            if (n>0){
                cout<<endl;
            }
        }
    }
}